package com.ms.test10;

/**
 * 单例的实现方式2
 * @author carter
 * create time    2018-08-20
 */
public class TestSingleton2 {

    private static TestSingleton2 singleton2;

    private TestSingleton2(){}


    public static TestSingleton2 getInstance()
    {
        if (null == singleton2)
        {
            singleton2 = new TestSingleton2();
        }

        return singleton2;

    }


}
